pay = int(input('输入应付多少: '))
money = 0
while True:
    gave = input('收下积分: ')
    if gave =='end':
        break
    money += int(gave)
print('实际收入的积分:',money)
change = money - pay
while True:
    if change >= 50:
        print('50')
        change -= 50
    elif change >= 20:
        print('20')
        change -= 20
    elif change >= 10:
        print('10')
        change -= 10
    elif change >= 5:
        print('5')
        change -= 5
    elif change >= 3:
        print('3')
        change -= 3
    elif change >= 2:
        print('2')
        change -= 2
    elif change >= 1:
        print("1")
        change -= 1
    elif change == 0:
        break
